<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>Docs For Class DB_Rowset</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
						<script src="../../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../../media/images/plus.png";
				imgMinus.src = "../../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> DB_Rowset</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
                <p class="implements">
            Implements interfaces:
            <ul>
                <li>Iterator (internal interface)</li><li>Countable (internal interface)</li>            </ul>
        </p>
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">A result of a database select query.</p>
<p class="description"><p>Instances of this class are returned by Rho_DB-&gt;select() and  Rho_DB-&gt;directSelect().  It contains DB_Record objects.</p><p>You can interate the rowset so: <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$rows</span>=<span class="src-var">$model</span><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$rows&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$row</span><span class="src-sym">)&nbsp;</span>:</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-var">$row</span><span class="src-sym">-&gt;</span><span class="src-id">id</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-key">endforeach</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;unset<span class="src-sym">(</span><span class="src-var">$rows</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p>Note that serialising DB_Record will call rewind().  On unserialising, current() will always be the first record in the rowset.</p></p>
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../Rho/Rho_DB.html#methodselect">Rho_DB::select()</a>, <a href="../../Rho/Rho-database/DB_Model.html">DB_Model</a>, <a href="../../Rho/Rho-database/DB_Record.html">DB_Record</a>, <a href="../../Rho/Rho-database/DB_Rowset.html#methodcurrent">DB_Rowset::current()</a></li>
				<li><span class="field">final:</span> </li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_rho---db.inc.php.html">/rho/db.inc.php</a> (line <span class="field">408</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																							
				<div class="method-definition">
					<img src="../../media/images/Constructor.png" alt=" "/>
											<span class="method-result">DB_Rowset</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">&$db</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$result</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$qty</span> = <span class="var-default">0</span>], <span class="var-type"></span>&nbsp;<span class="var-name">&$field_defs</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">&$model</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">&$record_class</span> = <span class="var-default">'DB_Record'</span>])
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#count" title="details" class="method-name">count</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result"><a href="../../Rho/Rho-database/DB_Record.html">DB_Record</a></span>
										<a href="#current" title="details" class="method-name">current</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#next" title="details" class="method-name">next</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#rewind" title="details" class="method-name">rewind</a>
										()
									</div>
											</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">441</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Creates a rowset from a query result.</p>
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../Rho/Rho_DB.html#methodselect">Rho_DB::select()</a>, <a href="../../Rho/Rho_DB.html#methoddirectSelect">Rho_DB::directSelect()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">DB_Rowset</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">&$db</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$result</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$qty</span> = <span class="var-default">0</span>], <span class="var-type"></span>&nbsp;<span class="var-name">&$field_defs</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">&$model</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">&$record_class</span> = <span class="var-default">'DB_Record'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">&$db</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">&$result</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$qty</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$field_defs</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">&$model</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">&$record_class</span>			</li>
				</ul>
		
			
	</div>
<a name="methodcount" id="count"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">count</span> (line <span class="line-number">563</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the number of rows in the rowset.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			count
		</span>
				()
			</div>
	
		
				<hr class="separator" />
		<div class="notes">Implementation of:</div>
			<dl>
			<dt>Countable::count</dt>
					</dl>
			
	</div>
<a name="methodcurrent" id="current"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">current</span> (line <span class="line-number">535</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the current row.</p>
	<ul class="tags">
				<li><span class="field">return:</span> A single record or NULL if the record set is empty.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../Rho/Rho-database/DB_Record.html">DB_Record</a></span>
		<span class="method-name">
			current
		</span>
				()
			</div>
	
		
				<hr class="separator" />
		<div class="notes">Implementation of:</div>
			<dl>
			<dt>Iterator::current</dt>
					</dl>
			
	</div>
<a name="methodnext" id="next"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">next</span> (line <span class="line-number">549</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Moves the internal pointer to the next row if not at the last row.</p>
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../Rho/Rho-database/DB_Rowset.html#methodcurrent">DB_Rowset::current()</a>, <a href="../../Rho/Rho-database/DB_Rowset.html#methodrewind">DB_Rowset::rewind()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			next
		</span>
				()
			</div>
	
		
				<hr class="separator" />
		<div class="notes">Implementation of:</div>
			<dl>
			<dt>Iterator::next</dt>
					</dl>
			
	</div>
<a name="methodrewind" id="rewind"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">rewind</span> (line <span class="line-number">518</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Rewinds the internal pointer.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			rewind
		</span>
				()
			</div>
	
		
				<hr class="separator" />
		<div class="notes">Implementation of:</div>
			<dl>
			<dt>Iterator::rewind</dt>
					</dl>
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Tue, 13 Oct 2009 19:17:23 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>